package com.dt.platform.domain.oa;

import com.github.foxnic.dao.entity.Entity;
import io.swagger.annotations.ApiModel;
import javax.persistence.Table;
import com.github.foxnic.sql.meta.DBTable;
import com.dt.platform.constants.db.OaTables.OA_PROJECT_TASK;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.Transient;
import com.github.foxnic.api.swagger.EnumFor;
import java.math.BigDecimal;
import javax.persistence.Id;
import org.github.foxnic.web.domain.system.DictItem;
import org.github.foxnic.web.domain.hrm.Employee;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.foxnic.commons.lang.DataParser;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import com.github.foxnic.dao.entity.EntityContext;
import com.dt.platform.domain.oa.meta.ProjectTaskMeta;
import com.github.foxnic.sql.data.ExprRcd;



/**
 * 项目任务
 * <p>项目任务 , 数据表 oa_project_task 的PO类型</p>
 * @author 金杰 , maillank@qq.com
 * @since 2025-07-06 16:29:16
 * @sign 13618CC7C05ED51C38C99F643FD7DE5D
 * 此文件由工具自动生成，请勿修改。若表结构或配置发生变动，请使用工具重新生成。
*/

@Table(name = "oa_project_task")
@ApiModel(description = "项目任务 ; 项目任务 , 数据表 oa_project_task 的PO类型")
public class ProjectTask extends Entity {

	private static final long serialVersionUID = 1L;

	public static final DBTable TABLE =OA_PROJECT_TASK.$TABLE;
	
	/**
	 * 实际完成日期：实际完成日期
	*/
	@ApiModelProperty(required = false,value="实际完成日期" , notes = "实际完成日期")
	private Date actualETime;
	
	/**
	 * 实际工时：实际工时
	*/
	@ApiModelProperty(required = false,value="实际工时" , notes = "实际工时")
	private Date actualWTime;
	
	/**
	 * 任务编号：任务编号
	*/
	@ApiModelProperty(required = false,value="任务编号" , notes = "任务编号" , example = "C480343")
	private String code;
	
	/**
	 * 创建人ID：创建人ID
	*/
	@ApiModelProperty(required = false,value="创建人ID" , notes = "创建人ID" , example = "110588348101165911")
	private String createBy;
	
	/**
	 * 创建时间：创建时间
	*/
	@ApiModelProperty(required = false,value="创建时间" , notes = "创建时间" , example = "2025-07-06 10:40:08")
	private Date createTime;
	
	/**
	 * 详细描述：详细描述
	*/
	@ApiModelProperty(required = false,value="详细描述" , notes = "详细描述" , example = "121212")
	private String ct;
	
	/**
	 * 删除人ID：删除人ID
	*/
	@ApiModelProperty(required = false,value="删除人ID" , notes = "删除人ID")
	private String deleteBy;
	
	/**
	 * 删除时间：删除时间
	*/
	@ApiModelProperty(required = false,value="删除时间" , notes = "删除时间")
	private Date deleteTime;
	
	/**
	 * 是否已删除：是否已删除
	*/
	@ApiModelProperty(required = true,value="是否已删除" , notes = "是否已删除" , example = "0")
	private Integer deleted;
	@Transient
	@EnumFor("deleted")
	private Boolean deletedBool;
	
	/**
	 * 预计结束日期：预计结束日期
	*/
	@ApiModelProperty(required = false,value="预计结束日期" , notes = "预计结束日期" , example = "2025-07-06 12:00:00")
	private Date estimateETime;
	
	/**
	 * 预估工时：预估工时
	*/
	@ApiModelProperty(required = false,value="预估工时" , notes = "预估工时" , example = "1.0")
	private BigDecimal estimateWTime;
	
	/**
	 * 附件：附件
	*/
	@ApiModelProperty(required = false,value="附件" , notes = "附件")
	private String fileId;
	
	/**
	 * 完成进度：完成进度
	*/
	@ApiModelProperty(required = false,value="完成进度" , notes = "完成进度" , example = "0.00")
	private BigDecimal finishPct;
	
	/**
	 * 主键：主键
	*/
	@Id
	@ApiModelProperty(required = true,value="主键" , notes = "主键" , example = "694817610940485")
	private String id;
	
	/**
	 * 负责人员：负责人员
	*/
	@ApiModelProperty(required = false,value="负责人员" , notes = "负责人员" , example = "E001")
	private String leaderId;
	
	/**
	 * 任务主题：任务主题
	*/
	@ApiModelProperty(required = false,value="任务主题" , notes = "任务主题" , example = "1212")
	private String name;
	
	/**
	 * 优先级：优先级
	*/
	@ApiModelProperty(required = false,value="优先级" , notes = "优先级" , example = "jj")
	private String priority;
	
	/**
	 * 项目名称：项目名称
	*/
	@ApiModelProperty(required = false,value="项目名称" , notes = "项目名称" , example = "709686941733355525")
	private String projectId;
	
	/**
	 * 状态：状态
	*/
	@ApiModelProperty(required = false,value="状态" , notes = "状态")
	private String status;
	
	/**
	 * 任务状态：任务状态
	*/
	@ApiModelProperty(required = false,value="任务状态" , notes = "任务状态" , example = "acting")
	private String taskStatus;
	
	/**
	 * 修改人ID：修改人ID
	*/
	@ApiModelProperty(required = false,value="修改人ID" , notes = "修改人ID" , example = "110588348101165911")
	private String updateBy;
	
	/**
	 * 修改时间：修改时间
	*/
	@ApiModelProperty(required = false,value="修改时间" , notes = "修改时间" , example = "2025-07-06 04:23:20")
	private Date updateTime;
	
	/**
	 * version：version
	*/
	@ApiModelProperty(required = false,value="version" , notes = "version" , example = "3")
	private Integer version;
	
	/**
	 * 工作类型：工作类型
	*/
	@ApiModelProperty(required = false,value="工作类型" , notes = "工作类型" , example = "zxwd")
	private String workType;
	
	/**
	 * workTypeDict：workTypeDict
	*/
	@ApiModelProperty(required = false,value="workTypeDict" , notes = "workTypeDict")
	private DictItem workTypeDict;
	
	/**
	 * priorityDict：priorityDict
	*/
	@ApiModelProperty(required = false,value="priorityDict" , notes = "priorityDict")
	private DictItem priorityDict;
	
	/**
	 * leader：leader
	*/
	@ApiModelProperty(required = false,value="leader" , notes = "leader")
	private Employee leader;
	
	/**
	 * partUserList：partUserList
	*/
	@ApiModelProperty(required = false,value="partUserList" , notes = "partUserList")
	private List<Employee> partUserList;
	
	/**
	 * partUserStrList：partUserStrList
	*/
	@ApiModelProperty(required = false,value="partUserStrList" , notes = "partUserStrList")
	private List<String> partUserStrList;
	
	/**
	 * project：project
	*/
	@ApiModelProperty(required = false,value="project" , notes = "project")
	private Project project;
	
	/**
	 * selectRange：selectRange
	*/
	@ApiModelProperty(required = false,value="selectRange" , notes = "selectRange")
	private String selectRange;
	
	/**
	 * taskRcdCount：taskRcdCount
	*/
	@ApiModelProperty(required = false,value="taskRcdCount" , notes = "taskRcdCount")
	private String taskRcdCount;
	
	/**
	 * taskRcdMineCount：taskRcdMineCount
	*/
	@ApiModelProperty(required = false,value="taskRcdMineCount" , notes = "taskRcdMineCount")
	private String taskRcdMineCount;
	
	/**
	 * workTimeTotal：workTimeTotal
	*/
	@ApiModelProperty(required = false,value="workTimeTotal" , notes = "workTimeTotal")
	private String workTimeTotal;
	
	/**
	 * tabStatus：tabStatus
	*/
	@ApiModelProperty(required = false,value="tabStatus" , notes = "tabStatus")
	private String tabStatus;
	
	/**
	 * 获得 实际完成日期<br>
	 * 实际完成日期
	 * @return 实际完成日期
	*/
	public Date getActualETime() {
		return actualETime;
	}
	
	/**
	 * 设置 实际完成日期
	 * @param actualETime 实际完成日期
	 * @return 当前对象
	*/
	public ProjectTask setActualETime(Date actualETime) {
		this.actualETime=actualETime;
		return this;
	}
	
	/**
	 * 获得 实际工时<br>
	 * 实际工时
	 * @return 实际工时
	*/
	public Date getActualWTime() {
		return actualWTime;
	}
	
	/**
	 * 设置 实际工时
	 * @param actualWTime 实际工时
	 * @return 当前对象
	*/
	public ProjectTask setActualWTime(Date actualWTime) {
		this.actualWTime=actualWTime;
		return this;
	}
	
	/**
	 * 获得 任务编号<br>
	 * 任务编号
	 * @return 任务编号
	*/
	public String getCode() {
		return code;
	}
	
	/**
	 * 设置 任务编号
	 * @param code 任务编号
	 * @return 当前对象
	*/
	public ProjectTask setCode(String code) {
		this.code=code;
		return this;
	}
	
	/**
	 * 获得 创建人ID<br>
	 * 创建人ID
	 * @return 创建人ID
	*/
	public String getCreateBy() {
		return createBy;
	}
	
	/**
	 * 设置 创建人ID
	 * @param createBy 创建人ID
	 * @return 当前对象
	*/
	public ProjectTask setCreateBy(String createBy) {
		this.createBy=createBy;
		return this;
	}
	
	/**
	 * 获得 创建时间<br>
	 * 创建时间
	 * @return 创建时间
	*/
	public Date getCreateTime() {
		return createTime;
	}
	
	/**
	 * 设置 创建时间
	 * @param createTime 创建时间
	 * @return 当前对象
	*/
	public ProjectTask setCreateTime(Date createTime) {
		this.createTime=createTime;
		return this;
	}
	
	/**
	 * 获得 详细描述<br>
	 * 详细描述
	 * @return 详细描述
	*/
	public String getCt() {
		return ct;
	}
	
	/**
	 * 设置 详细描述
	 * @param ct 详细描述
	 * @return 当前对象
	*/
	public ProjectTask setCt(String ct) {
		this.ct=ct;
		return this;
	}
	
	/**
	 * 获得 删除人ID<br>
	 * 删除人ID
	 * @return 删除人ID
	*/
	public String getDeleteBy() {
		return deleteBy;
	}
	
	/**
	 * 设置 删除人ID
	 * @param deleteBy 删除人ID
	 * @return 当前对象
	*/
	public ProjectTask setDeleteBy(String deleteBy) {
		this.deleteBy=deleteBy;
		return this;
	}
	
	/**
	 * 获得 删除时间<br>
	 * 删除时间
	 * @return 删除时间
	*/
	public Date getDeleteTime() {
		return deleteTime;
	}
	
	/**
	 * 设置 删除时间
	 * @param deleteTime 删除时间
	 * @return 当前对象
	*/
	public ProjectTask setDeleteTime(Date deleteTime) {
		this.deleteTime=deleteTime;
		return this;
	}
	
	/**
	 * 获得 是否已删除<br>
	 * 是否已删除
	 * @return 是否已删除
	*/
	public Integer getDeleted() {
		return deleted;
	}
	
	/**
	 * 获得 是否已删除 的投影属性<br>
	 * 等价于 getDeleted 方法，获得对应的枚举类型
	 * @return 是否已删除
	*/
	@Transient
	public Boolean isDeleted() {
		if(this.deletedBool==null) {
			this.deletedBool=DataParser.parseBoolean(deleted);
		}
		return this.deletedBool ;
	}
	
	/**
	 * 设置 是否已删除
	 * @param deleted 是否已删除
	 * @return 当前对象
	*/
	@JsonProperty("deleted")
	public ProjectTask setDeleted(Integer deleted) {
		this.deleted=deleted;
		this.deletedBool=DataParser.parseBoolean(deleted);
		return this;
	}
	
	/**
	 * 设置 是否已删除的投影属性，等同于设置 是否已删除
	 * @param deletedBool 是否已删除
	 * @return 当前对象
	*/
	@Transient
	public ProjectTask setDeleted(Boolean deletedBool) {
		if(deletedBool==null) {
			this.deleted=null;
		} else {
			this.deleted=deletedBool?1:0;
		}
		this.deletedBool=deletedBool;
		return this;
	}
	
	/**
	 * 获得 预计结束日期<br>
	 * 预计结束日期
	 * @return 预计结束日期
	*/
	public Date getEstimateETime() {
		return estimateETime;
	}
	
	/**
	 * 设置 预计结束日期
	 * @param estimateETime 预计结束日期
	 * @return 当前对象
	*/
	public ProjectTask setEstimateETime(Date estimateETime) {
		this.estimateETime=estimateETime;
		return this;
	}
	
	/**
	 * 获得 预估工时<br>
	 * 预估工时
	 * @return 预估工时
	*/
	public BigDecimal getEstimateWTime() {
		return estimateWTime;
	}
	
	/**
	 * 设置 预估工时
	 * @param estimateWTime 预估工时
	 * @return 当前对象
	*/
	public ProjectTask setEstimateWTime(BigDecimal estimateWTime) {
		this.estimateWTime=estimateWTime;
		return this;
	}
	
	/**
	 * 获得 附件<br>
	 * 附件
	 * @return 附件
	*/
	public String getFileId() {
		return fileId;
	}
	
	/**
	 * 设置 附件
	 * @param fileId 附件
	 * @return 当前对象
	*/
	public ProjectTask setFileId(String fileId) {
		this.fileId=fileId;
		return this;
	}
	
	/**
	 * 获得 完成进度<br>
	 * 完成进度
	 * @return 完成进度
	*/
	public BigDecimal getFinishPct() {
		return finishPct;
	}
	
	/**
	 * 设置 完成进度
	 * @param finishPct 完成进度
	 * @return 当前对象
	*/
	public ProjectTask setFinishPct(BigDecimal finishPct) {
		this.finishPct=finishPct;
		return this;
	}
	
	/**
	 * 获得 主键<br>
	 * 主键
	 * @return 主键
	*/
	public String getId() {
		return id;
	}
	
	/**
	 * 设置 主键
	 * @param id 主键
	 * @return 当前对象
	*/
	public ProjectTask setId(String id) {
		this.id=id;
		return this;
	}
	
	/**
	 * 获得 负责人员<br>
	 * 负责人员
	 * @return 负责人员
	*/
	public String getLeaderId() {
		return leaderId;
	}
	
	/**
	 * 设置 负责人员
	 * @param leaderId 负责人员
	 * @return 当前对象
	*/
	public ProjectTask setLeaderId(String leaderId) {
		this.leaderId=leaderId;
		return this;
	}
	
	/**
	 * 获得 任务主题<br>
	 * 任务主题
	 * @return 任务主题
	*/
	public String getName() {
		return name;
	}
	
	/**
	 * 设置 任务主题
	 * @param name 任务主题
	 * @return 当前对象
	*/
	public ProjectTask setName(String name) {
		this.name=name;
		return this;
	}
	
	/**
	 * 获得 优先级<br>
	 * 优先级
	 * @return 优先级
	*/
	public String getPriority() {
		return priority;
	}
	
	/**
	 * 设置 优先级
	 * @param priority 优先级
	 * @return 当前对象
	*/
	public ProjectTask setPriority(String priority) {
		this.priority=priority;
		return this;
	}
	
	/**
	 * 获得 项目名称<br>
	 * 项目名称
	 * @return 项目名称
	*/
	public String getProjectId() {
		return projectId;
	}
	
	/**
	 * 设置 项目名称
	 * @param projectId 项目名称
	 * @return 当前对象
	*/
	public ProjectTask setProjectId(String projectId) {
		this.projectId=projectId;
		return this;
	}
	
	/**
	 * 获得 状态<br>
	 * 状态
	 * @return 状态
	*/
	public String getStatus() {
		return status;
	}
	
	/**
	 * 设置 状态
	 * @param status 状态
	 * @return 当前对象
	*/
	public ProjectTask setStatus(String status) {
		this.status=status;
		return this;
	}
	
	/**
	 * 获得 任务状态<br>
	 * 任务状态
	 * @return 任务状态
	*/
	public String getTaskStatus() {
		return taskStatus;
	}
	
	/**
	 * 设置 任务状态
	 * @param taskStatus 任务状态
	 * @return 当前对象
	*/
	public ProjectTask setTaskStatus(String taskStatus) {
		this.taskStatus=taskStatus;
		return this;
	}
	
	/**
	 * 获得 修改人ID<br>
	 * 修改人ID
	 * @return 修改人ID
	*/
	public String getUpdateBy() {
		return updateBy;
	}
	
	/**
	 * 设置 修改人ID
	 * @param updateBy 修改人ID
	 * @return 当前对象
	*/
	public ProjectTask setUpdateBy(String updateBy) {
		this.updateBy=updateBy;
		return this;
	}
	
	/**
	 * 获得 修改时间<br>
	 * 修改时间
	 * @return 修改时间
	*/
	public Date getUpdateTime() {
		return updateTime;
	}
	
	/**
	 * 设置 修改时间
	 * @param updateTime 修改时间
	 * @return 当前对象
	*/
	public ProjectTask setUpdateTime(Date updateTime) {
		this.updateTime=updateTime;
		return this;
	}
	
	/**
	 * 获得 version<br>
	 * version
	 * @return version
	*/
	public Integer getVersion() {
		return version;
	}
	
	/**
	 * 设置 version
	 * @param version version
	 * @return 当前对象
	*/
	public ProjectTask setVersion(Integer version) {
		this.version=version;
		return this;
	}
	
	/**
	 * 获得 工作类型<br>
	 * 工作类型
	 * @return 工作类型
	*/
	public String getWorkType() {
		return workType;
	}
	
	/**
	 * 设置 工作类型
	 * @param workType 工作类型
	 * @return 当前对象
	*/
	public ProjectTask setWorkType(String workType) {
		this.workType=workType;
		return this;
	}
	
	/**
	 * 获得 workTypeDict<br>
	 * workTypeDict
	 * @return workTypeDict
	*/
	public DictItem getWorkTypeDict() {
		return workTypeDict;
	}
	
	/**
	 * 设置 workTypeDict
	 * @param workTypeDict workTypeDict
	 * @return 当前对象
	*/
	public ProjectTask setWorkTypeDict(DictItem workTypeDict) {
		this.workTypeDict=workTypeDict;
		return this;
	}
	
	/**
	 * 获得 priorityDict<br>
	 * priorityDict
	 * @return priorityDict
	*/
	public DictItem getPriorityDict() {
		return priorityDict;
	}
	
	/**
	 * 设置 priorityDict
	 * @param priorityDict priorityDict
	 * @return 当前对象
	*/
	public ProjectTask setPriorityDict(DictItem priorityDict) {
		this.priorityDict=priorityDict;
		return this;
	}
	
	/**
	 * 获得 leader<br>
	 * leader
	 * @return leader
	*/
	public Employee getLeader() {
		return leader;
	}
	
	/**
	 * 设置 leader
	 * @param leader leader
	 * @return 当前对象
	*/
	public ProjectTask setLeader(Employee leader) {
		this.leader=leader;
		return this;
	}
	
	/**
	 * 获得 partUserList<br>
	 * partUserList
	 * @return partUserList
	*/
	public List<Employee> getPartUserList() {
		return partUserList;
	}
	
	/**
	 * 设置 partUserList
	 * @param partUserList partUserList
	 * @return 当前对象
	*/
	public ProjectTask setPartUserList(List<Employee> partUserList) {
		this.partUserList=partUserList;
		return this;
	}
	
	/**
	 * 添加 partUserList
	 * @param partUser partUserList
	 * @return 当前对象
	*/
	public ProjectTask addPartUser(Employee... partUser) {
		if(this.partUserList==null) {
			partUserList=new ArrayList<>();
		}
		this.partUserList.addAll(Arrays.asList(partUser));
		return this;
	}
	
	/**
	 * 获得 partUserStrList<br>
	 * partUserStrList
	 * @return partUserStrList
	*/
	public List<String> getPartUserStrList() {
		return partUserStrList;
	}
	
	/**
	 * 设置 partUserStrList
	 * @param partUserStrList partUserStrList
	 * @return 当前对象
	*/
	public ProjectTask setPartUserStrList(List<String> partUserStrList) {
		this.partUserStrList=partUserStrList;
		return this;
	}
	
	/**
	 * 添加 partUserStrList
	 * @param partUserStr partUserStrList
	 * @return 当前对象
	*/
	public ProjectTask addPartUserStr(String... partUserStr) {
		if(this.partUserStrList==null) {
			partUserStrList=new ArrayList<>();
		}
		this.partUserStrList.addAll(Arrays.asList(partUserStr));
		return this;
	}
	
	/**
	 * 获得 project<br>
	 * project
	 * @return project
	*/
	public Project getProject() {
		return project;
	}
	
	/**
	 * 设置 project
	 * @param project project
	 * @return 当前对象
	*/
	public ProjectTask setProject(Project project) {
		this.project=project;
		return this;
	}
	
	/**
	 * 获得 selectRange<br>
	 * selectRange
	 * @return selectRange
	*/
	public String getSelectRange() {
		return selectRange;
	}
	
	/**
	 * 设置 selectRange
	 * @param selectRange selectRange
	 * @return 当前对象
	*/
	public ProjectTask setSelectRange(String selectRange) {
		this.selectRange=selectRange;
		return this;
	}
	
	/**
	 * 获得 taskRcdCount<br>
	 * taskRcdCount
	 * @return taskRcdCount
	*/
	public String getTaskRcdCount() {
		return taskRcdCount;
	}
	
	/**
	 * 设置 taskRcdCount
	 * @param taskRcdCount taskRcdCount
	 * @return 当前对象
	*/
	public ProjectTask setTaskRcdCount(String taskRcdCount) {
		this.taskRcdCount=taskRcdCount;
		return this;
	}
	
	/**
	 * 获得 taskRcdMineCount<br>
	 * taskRcdMineCount
	 * @return taskRcdMineCount
	*/
	public String getTaskRcdMineCount() {
		return taskRcdMineCount;
	}
	
	/**
	 * 设置 taskRcdMineCount
	 * @param taskRcdMineCount taskRcdMineCount
	 * @return 当前对象
	*/
	public ProjectTask setTaskRcdMineCount(String taskRcdMineCount) {
		this.taskRcdMineCount=taskRcdMineCount;
		return this;
	}
	
	/**
	 * 获得 workTimeTotal<br>
	 * workTimeTotal
	 * @return workTimeTotal
	*/
	public String getWorkTimeTotal() {
		return workTimeTotal;
	}
	
	/**
	 * 设置 workTimeTotal
	 * @param workTimeTotal workTimeTotal
	 * @return 当前对象
	*/
	public ProjectTask setWorkTimeTotal(String workTimeTotal) {
		this.workTimeTotal=workTimeTotal;
		return this;
	}
	
	/**
	 * 获得 tabStatus<br>
	 * tabStatus
	 * @return tabStatus
	*/
	public String getTabStatus() {
		return tabStatus;
	}
	
	/**
	 * 设置 tabStatus
	 * @param tabStatus tabStatus
	 * @return 当前对象
	*/
	public ProjectTask setTabStatus(String tabStatus) {
		this.tabStatus=tabStatus;
		return this;
	}

	/**
	 * 将自己转换成指定类型的PO
	 * @param poType  PO类型
	 * @return ProjectTask , 转换好的 ProjectTask 对象
	*/
	@Transient
	public <T extends Entity> T toPO(Class<T> poType) {
		return EntityContext.create(poType, this);
	}

	/**
	 * 将自己转换成任意指定类型
	 * @param pojoType  Pojo类型
	 * @return ProjectTask , 转换好的 PoJo 对象
	*/
	@Transient
	public <T> T toPojo(Class<T> pojoType) {
		if(Entity.class.isAssignableFrom(pojoType)) {
			return (T)this.toPO((Class<Entity>)pojoType);
		}
		try {
			T pojo=pojoType.newInstance();
			EntityContext.copyProperties(pojo, this);
			return pojo;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public ProjectTask clone() {
		return duplicate(true);
	}

	/**
	 * 复制当前对象
	 * @param all 是否复制全部属性，当 false 时，仅复制来自数据表的属性
	*/
	@Transient
	public ProjectTask duplicate(boolean all) {
		com.dt.platform.domain.oa.meta.ProjectTaskMeta.$$proxy$$ inst = new com.dt.platform.domain.oa.meta.ProjectTaskMeta.$$proxy$$();
		inst.setCode(this.getCode());
		inst.setActualWTime(this.getActualWTime());
		inst.setUpdateTime(this.getUpdateTime());
		inst.setPriority(this.getPriority());
		inst.setVersion(this.getVersion());
		inst.setEstimateWTime(this.getEstimateWTime());
		inst.setLeaderId(this.getLeaderId());
		inst.setFinishPct(this.getFinishPct());
		inst.setCt(this.getCt());
		inst.setActualETime(this.getActualETime());
		inst.setCreateBy(this.getCreateBy());
		inst.setDeleted(this.getDeleted());
		inst.setCreateTime(this.getCreateTime());
		inst.setDeleteTime(this.getDeleteTime());
		inst.setUpdateBy(this.getUpdateBy());
		inst.setName(this.getName());
		inst.setWorkType(this.getWorkType());
		inst.setDeleteBy(this.getDeleteBy());
		inst.setId(this.getId());
		inst.setProjectId(this.getProjectId());
		inst.setEstimateETime(this.getEstimateETime());
		inst.setTaskStatus(this.getTaskStatus());
		inst.setFileId(this.getFileId());
		inst.setStatus(this.getStatus());
		if(all) {
			inst.setTaskRcdCount(this.getTaskRcdCount());
			inst.setPriorityDict(this.getPriorityDict());
			inst.setLeader(this.getLeader());
			inst.setPartUserStrList(this.getPartUserStrList());
			inst.setSelectRange(this.getSelectRange());
			inst.setPartUserList(this.getPartUserList());
			inst.setProject(this.getProject());
			inst.setTaskRcdMineCount(this.getTaskRcdMineCount());
			inst.setWorkTimeTotal(this.getWorkTimeTotal());
			inst.setWorkTypeDict(this.getWorkTypeDict());
			inst.setTabStatus(this.getTabStatus());
		}
		inst.clearModifies();
		return inst;
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public ProjectTask clone(boolean deep) {
		return EntityContext.clone(ProjectTask.class,this,deep);
	}

	/**
	 * 将 Map 转换成 ProjectTask
	 * @param projectTaskMap 包含实体信息的 Map 对象
	 * @return ProjectTask , 转换好的的 ProjectTask 对象
	*/
	@Transient
	public static ProjectTask createFrom(Map<String,Object> projectTaskMap) {
		if(projectTaskMap==null) return null;
		ProjectTask po = create();
		EntityContext.copyProperties(po,projectTaskMap);
		po.clearModifies();
		return po;
	}

	/**
	 * 将 Pojo 转换成 ProjectTask
	 * @param pojo 包含实体信息的 Pojo 对象
	 * @return ProjectTask , 转换好的的 ProjectTask 对象
	*/
	@Transient
	public static ProjectTask createFrom(Object pojo) {
		if(pojo==null) return null;
		ProjectTask po = create();
		EntityContext.copyProperties(po,pojo);
		po.clearModifies();
		return po;
	}

	/**
	 * 创建一个 ProjectTask，等同于 new
	 * @return ProjectTask 对象
	*/
	@Transient
	public static ProjectTask create() {
		return new com.dt.platform.domain.oa.meta.ProjectTaskMeta.$$proxy$$();
	}

	/**
	 * 从 Map 读取
	 * @param map 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(Map<String, Object> map,boolean cast) {
		if(map==null) return false;
		if(cast) {
			this.setCode(DataParser.parse(String.class, map.get(ProjectTaskMeta.CODE)));
			this.setActualWTime(DataParser.parse(Date.class, map.get(ProjectTaskMeta.ACTUAL_W_TIME)));
			this.setUpdateTime(DataParser.parse(Date.class, map.get(ProjectTaskMeta.UPDATE_TIME)));
			this.setPriority(DataParser.parse(String.class, map.get(ProjectTaskMeta.PRIORITY)));
			this.setVersion(DataParser.parse(Integer.class, map.get(ProjectTaskMeta.VERSION)));
			this.setEstimateWTime(DataParser.parse(BigDecimal.class, map.get(ProjectTaskMeta.ESTIMATE_W_TIME)));
			this.setLeaderId(DataParser.parse(String.class, map.get(ProjectTaskMeta.LEADER_ID)));
			this.setFinishPct(DataParser.parse(BigDecimal.class, map.get(ProjectTaskMeta.FINISH_PCT)));
			this.setCt(DataParser.parse(String.class, map.get(ProjectTaskMeta.CT)));
			this.setActualETime(DataParser.parse(Date.class, map.get(ProjectTaskMeta.ACTUAL_E_TIME)));
			this.setCreateBy(DataParser.parse(String.class, map.get(ProjectTaskMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, map.get(ProjectTaskMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, map.get(ProjectTaskMeta.CREATE_TIME)));
			this.setDeleteTime(DataParser.parse(Date.class, map.get(ProjectTaskMeta.DELETE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, map.get(ProjectTaskMeta.UPDATE_BY)));
			this.setName(DataParser.parse(String.class, map.get(ProjectTaskMeta.NAME)));
			this.setWorkType(DataParser.parse(String.class, map.get(ProjectTaskMeta.WORK_TYPE)));
			this.setDeleteBy(DataParser.parse(String.class, map.get(ProjectTaskMeta.DELETE_BY)));
			this.setId(DataParser.parse(String.class, map.get(ProjectTaskMeta.ID)));
			this.setProjectId(DataParser.parse(String.class, map.get(ProjectTaskMeta.PROJECT_ID)));
			this.setEstimateETime(DataParser.parse(Date.class, map.get(ProjectTaskMeta.ESTIMATE_E_TIME)));
			this.setTaskStatus(DataParser.parse(String.class, map.get(ProjectTaskMeta.TASK_STATUS)));
			this.setFileId(DataParser.parse(String.class, map.get(ProjectTaskMeta.FILE_ID)));
			this.setStatus(DataParser.parse(String.class, map.get(ProjectTaskMeta.STATUS)));
			// others
			this.setTaskRcdCount(DataParser.parse(String.class, map.get(ProjectTaskMeta.TASK_RCD_COUNT)));
			this.setPriorityDict(DataParser.parse(DictItem.class, map.get(ProjectTaskMeta.PRIORITY_DICT)));
			this.setLeader(DataParser.parse(Employee.class, map.get(ProjectTaskMeta.LEADER)));
			this.setSelectRange(DataParser.parse(String.class, map.get(ProjectTaskMeta.SELECT_RANGE)));
			this.setProject(DataParser.parse(Project.class, map.get(ProjectTaskMeta.PROJECT)));
			this.setTaskRcdMineCount(DataParser.parse(String.class, map.get(ProjectTaskMeta.TASK_RCD_MINE_COUNT)));
			this.setWorkTimeTotal(DataParser.parse(String.class, map.get(ProjectTaskMeta.WORK_TIME_TOTAL)));
			this.setWorkTypeDict(DataParser.parse(DictItem.class, map.get(ProjectTaskMeta.WORK_TYPE_DICT)));
			this.setTabStatus(DataParser.parse(String.class, map.get(ProjectTaskMeta.TAB_STATUS)));
			return true;
		} else {
			try {
				this.setCode( (String)map.get(ProjectTaskMeta.CODE));
				this.setActualWTime( (Date)map.get(ProjectTaskMeta.ACTUAL_W_TIME));
				this.setUpdateTime( (Date)map.get(ProjectTaskMeta.UPDATE_TIME));
				this.setPriority( (String)map.get(ProjectTaskMeta.PRIORITY));
				this.setVersion( (Integer)map.get(ProjectTaskMeta.VERSION));
				this.setEstimateWTime( (BigDecimal)map.get(ProjectTaskMeta.ESTIMATE_W_TIME));
				this.setLeaderId( (String)map.get(ProjectTaskMeta.LEADER_ID));
				this.setFinishPct( (BigDecimal)map.get(ProjectTaskMeta.FINISH_PCT));
				this.setCt( (String)map.get(ProjectTaskMeta.CT));
				this.setActualETime( (Date)map.get(ProjectTaskMeta.ACTUAL_E_TIME));
				this.setCreateBy( (String)map.get(ProjectTaskMeta.CREATE_BY));
				this.setDeleted( (Integer)map.get(ProjectTaskMeta.DELETED));
				this.setCreateTime( (Date)map.get(ProjectTaskMeta.CREATE_TIME));
				this.setDeleteTime( (Date)map.get(ProjectTaskMeta.DELETE_TIME));
				this.setUpdateBy( (String)map.get(ProjectTaskMeta.UPDATE_BY));
				this.setName( (String)map.get(ProjectTaskMeta.NAME));
				this.setWorkType( (String)map.get(ProjectTaskMeta.WORK_TYPE));
				this.setDeleteBy( (String)map.get(ProjectTaskMeta.DELETE_BY));
				this.setId( (String)map.get(ProjectTaskMeta.ID));
				this.setProjectId( (String)map.get(ProjectTaskMeta.PROJECT_ID));
				this.setEstimateETime( (Date)map.get(ProjectTaskMeta.ESTIMATE_E_TIME));
				this.setTaskStatus( (String)map.get(ProjectTaskMeta.TASK_STATUS));
				this.setFileId( (String)map.get(ProjectTaskMeta.FILE_ID));
				this.setStatus( (String)map.get(ProjectTaskMeta.STATUS));
				// others
				this.setTaskRcdCount( (String)map.get(ProjectTaskMeta.TASK_RCD_COUNT));
				this.setPriorityDict( (DictItem)map.get(ProjectTaskMeta.PRIORITY_DICT));
				this.setLeader( (Employee)map.get(ProjectTaskMeta.LEADER));
				this.setSelectRange( (String)map.get(ProjectTaskMeta.SELECT_RANGE));
				this.setProject( (Project)map.get(ProjectTaskMeta.PROJECT));
				this.setTaskRcdMineCount( (String)map.get(ProjectTaskMeta.TASK_RCD_MINE_COUNT));
				this.setWorkTimeTotal( (String)map.get(ProjectTaskMeta.WORK_TIME_TOTAL));
				this.setWorkTypeDict( (DictItem)map.get(ProjectTaskMeta.WORK_TYPE_DICT));
				this.setTabStatus( (String)map.get(ProjectTaskMeta.TAB_STATUS));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}

	/**
	 * 从 Map 读取
	 * @param r 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(ExprRcd r,boolean cast) {
		if(r==null) return false;
		if(cast) {
			this.setCode(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.CODE)));
			this.setActualWTime(DataParser.parse(Date.class, r.getValue(ProjectTaskMeta.ACTUAL_W_TIME)));
			this.setUpdateTime(DataParser.parse(Date.class, r.getValue(ProjectTaskMeta.UPDATE_TIME)));
			this.setPriority(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.PRIORITY)));
			this.setVersion(DataParser.parse(Integer.class, r.getValue(ProjectTaskMeta.VERSION)));
			this.setEstimateWTime(DataParser.parse(BigDecimal.class, r.getValue(ProjectTaskMeta.ESTIMATE_W_TIME)));
			this.setLeaderId(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.LEADER_ID)));
			this.setFinishPct(DataParser.parse(BigDecimal.class, r.getValue(ProjectTaskMeta.FINISH_PCT)));
			this.setCt(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.CT)));
			this.setActualETime(DataParser.parse(Date.class, r.getValue(ProjectTaskMeta.ACTUAL_E_TIME)));
			this.setCreateBy(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, r.getValue(ProjectTaskMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, r.getValue(ProjectTaskMeta.CREATE_TIME)));
			this.setDeleteTime(DataParser.parse(Date.class, r.getValue(ProjectTaskMeta.DELETE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.UPDATE_BY)));
			this.setName(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.NAME)));
			this.setWorkType(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.WORK_TYPE)));
			this.setDeleteBy(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.DELETE_BY)));
			this.setId(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.ID)));
			this.setProjectId(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.PROJECT_ID)));
			this.setEstimateETime(DataParser.parse(Date.class, r.getValue(ProjectTaskMeta.ESTIMATE_E_TIME)));
			this.setTaskStatus(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.TASK_STATUS)));
			this.setFileId(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.FILE_ID)));
			this.setStatus(DataParser.parse(String.class, r.getValue(ProjectTaskMeta.STATUS)));
			return true;
		} else {
			try {
				this.setCode( (String)r.getValue(ProjectTaskMeta.CODE));
				this.setActualWTime( (Date)r.getValue(ProjectTaskMeta.ACTUAL_W_TIME));
				this.setUpdateTime( (Date)r.getValue(ProjectTaskMeta.UPDATE_TIME));
				this.setPriority( (String)r.getValue(ProjectTaskMeta.PRIORITY));
				this.setVersion( (Integer)r.getValue(ProjectTaskMeta.VERSION));
				this.setEstimateWTime( (BigDecimal)r.getValue(ProjectTaskMeta.ESTIMATE_W_TIME));
				this.setLeaderId( (String)r.getValue(ProjectTaskMeta.LEADER_ID));
				this.setFinishPct( (BigDecimal)r.getValue(ProjectTaskMeta.FINISH_PCT));
				this.setCt( (String)r.getValue(ProjectTaskMeta.CT));
				this.setActualETime( (Date)r.getValue(ProjectTaskMeta.ACTUAL_E_TIME));
				this.setCreateBy( (String)r.getValue(ProjectTaskMeta.CREATE_BY));
				this.setDeleted( (Integer)r.getValue(ProjectTaskMeta.DELETED));
				this.setCreateTime( (Date)r.getValue(ProjectTaskMeta.CREATE_TIME));
				this.setDeleteTime( (Date)r.getValue(ProjectTaskMeta.DELETE_TIME));
				this.setUpdateBy( (String)r.getValue(ProjectTaskMeta.UPDATE_BY));
				this.setName( (String)r.getValue(ProjectTaskMeta.NAME));
				this.setWorkType( (String)r.getValue(ProjectTaskMeta.WORK_TYPE));
				this.setDeleteBy( (String)r.getValue(ProjectTaskMeta.DELETE_BY));
				this.setId( (String)r.getValue(ProjectTaskMeta.ID));
				this.setProjectId( (String)r.getValue(ProjectTaskMeta.PROJECT_ID));
				this.setEstimateETime( (Date)r.getValue(ProjectTaskMeta.ESTIMATE_E_TIME));
				this.setTaskStatus( (String)r.getValue(ProjectTaskMeta.TASK_STATUS));
				this.setFileId( (String)r.getValue(ProjectTaskMeta.FILE_ID));
				this.setStatus( (String)r.getValue(ProjectTaskMeta.STATUS));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}
}